const userProfile = ({name}) => {
    return (<div>这是{ name}的仪表盘</div>)
}

function AuthComponent(WrapComponent)
{
    return (props) => {
        const {isAuthorized} = props;
        if (isAuthorized)
        {
            console.log(isAuthorized);
            return <WrapComponent {...props}></WrapComponent>;    
        }
        return (
            <div>对不起，你没有访问权限</div>
        )
    }
}

const AuthorizedWrapper = AuthComponent(userProfile);

export default AuthorizedWrapper;